package controllers

import "hw_admin/models"

type RoleController struct {
	BaseController
}

//角色列表
func (this *RoleController) List()  {
	var  adminRole models.AdminRole
	//获取前端传入的数据
	pageNo,_  := this.GetInt("pageNo",1)
	pageSize,_  := this.GetInt("pageSize",10)
	beginTime := this.GetString("beginTime","")
	endTime := this.GetString("endTime","")
	name := this.GetString("name","")
	roles,total, err := adminRole.GetList(pageNo,pageSize,beginTime,endTime,name)
	if err == nil {
		page := this.GetPage(total,pageNo,pageSize)
		this.Data["page"] = page
		this.Data["roles"] = roles
		this.Data["total"] = total
	}
	this.TplName = "admin-role.html"
}

//添加页面
func (this *RoleController) InsertView()  {
	//TODO 获取权限列表
	this.TplName = "role-add.html"
}